<script language="javascript" type="text/javascript">
	$('#button').click(function() {
	   var var_name = $("input[name='Cliente']:checked").val();
	   var jrole = "ricezione/newbook.php?idcliente="+var_name;
			$('#index').slideUp(1000,function(){$('#index').load(jrole,'',$('#index').slideDown(1000))});
		return false;
    }); 

    </script>

<?php
require("../Connections/mlu.php");
  
  if (isset($_GET['codcliente']))
  {
	  $id=$_GET['codcliente'];
  	  $id=(int)($id/10);
  	  $insertSQL = "select * from clienti where ID ='$id'";
  }
  if (isset($_GET['Cognome']))
  {
	  $id=$_GET['Cognome'];

  	  $insertSQL = "select * from clienti where cognome like '$id%'";
  }
  $Result1 = mysql_query($insertSQL, $mlu) or die(mysql_error());
  $tot=mysql_num_rows($Result1);
 		?>
<table border="1" align="center" class="tabellalibri">
  <tr>
      <td>&nbsp;</td>
      <td> Idcliente </td>
      <td> Cognome </td>
      <td> Nome </td>
      <td> Indirizzo</td>
    </tr>
  <?php
		while ($row_Result1 = mysql_fetch_assoc($Result1))
		{
			?>
    <tr>
      <td><input type="radio" name="Cliente" value="<?php echo $row_Result1['ID']; ?>" id="Cliente"/>  </td>
      <td> <?php echo $row_Result1['ID']; ?> </td>
      <td> <?php echo $row_Result1['Cognome']; ?> </td>
      <td> <?php echo $row_Result1['Nome']; ?> </td>
      <td> <?php echo $row_Result1['Indirizzo']; ?> </td>
    </tr>
            
<?php		}
?>      </table>
<p>
  <input type="submit" name="button" id="button" value="Invia" />
</p>
